package net.googlecode.demenkov.task4;

import net.googlecode.demenkov.task4.source.ConstantString;
import net.googlecode.demenkov.task4.utils.*;

/**
 * String manager that makes String Normalization, Changes all letters A,
 * Inputs date, Reverse Words, and make First letter in uppercase in
 * Base string.
 *
 * @author Yura Demenkov
 * @since 04.04.11
 */
public class StringManager implements ConstantString {

    /**
     * makes String Normalization, Changes all letters A,
     * Inputs date, Reverse Words, and make First letter in uppercase in
     * Base string.
     *
     * @param args
     */
    public static void main(String[] args) {
        StringManager sm = new StringManager();
        sm.PrintBaseString();
        sm.NormalizeString();
        sm.UpperFrist();
        sm.ReverseWords();
        sm.ChangeLettersA();
        sm.InputDate();
    }

    /**
     * Prints BaseString.
     */
    public void PrintBaseString() {
        System.out.println("Base string:");
        System.out.println(BASESTRING);
        System.out.println();
    }

    /**
     * Makes string normalization.
     */
    public void NormalizeString() {
        StringNormalizer normalizer = new StringNormalizer(BASESTRING);
        normalizer.NormaliseString();

    }

    /**
     * Makes first letters in uppercase.
     */
    public void UpperFrist() {
        UpperFirst upperFirst = new UpperFirst(BASESTRING);
        upperFirst.MakeFirstUpper();
    }

    /**
     * Reverse letters in every word.
     */
    public void ReverseWords() {
        ReverseWords reversWords = new ReverseWords(BASESTRING);
        reversWords.ReverseCharsInWords();
    }

    /**
     * Inputs date in the end of string.
     */
    public void InputDate() {
        InputDate id = new InputDate(BASESTRING);
        id.InputDateAfterDot();
    }


    /**
     * Change letter 'A' and 'a' to '!'.
     */
    public void ChangeLettersA() {
        ChangeLettersA chA = new ChangeLettersA(BASESTRING);
        chA.ChangeA();
    }
}
